// boot_win32.c
//
//		This file is the entry point of the game

#include <stdio.h>
#include <stdlib.h>
#include <GLES2/gl2.h>
#include <game.h>
#include "esUtil.h"

int Init ( ESContext *esContext )
{
	return GAME->init();
}

void Draw ( ESContext *esContext )
{
	// Set the viewport
	glViewport ( 0, 0, esContext->width, esContext->height );
	
	// Clear the color buffer
	glClear ( GL_COLOR_BUFFER_BIT );

	GAME->draw();

	eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
}

int main(int argc, char ** argv)
{
	system("title Boot");
	ESContext esContext;
	esInitContext ( &esContext );

	esCreateWindow ( &esContext, "Boot", 1024, 1024, ES_WINDOW_RGB );

	if ( !Init ( &esContext ) )
      return 1;

	esRegisterDrawFunc ( &esContext, Draw );

	esMainLoop ( &esContext );
	
	GAME->destroy();

	system("pause");
	return 0;
}